//
//  KYMatchDorctorModel.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/16.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYMatchDorctorModel.h"
#import "KYNetTool.h"
#import <MJExtension.h>

@implementation KYMatchDorctorModel
+(void)getMatchDorctorModelSuccess:(void(^)(NSMutableArray *dorctorModel))success{
    NSString *url = @"http://iosapi.itcast.cn/matchDoctors.json.php";
    NSDictionary *paramDic = @{@"ci1_id":@(1),@"ci2_id":@(3),@"ci3_id":@(3),@"diagnosis_type":@(0),@"page_size":@(15),@"is_confirmed":@(1),@"user_id":@(1000089), @"page":@(1),@"has_diagnosis":@(2)};
    [[KYNetTool shareManager]POST:url parameters:paramDic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *response = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil];
        NSArray *array = response[@"data"];
        NSMutableArray *temp = [NSMutableArray array];
        for (NSDictionary *dict in array) {
            KYMatchDorctorModel *model = [KYMatchDorctorModel mj_objectWithKeyValues:dict];
            [temp addObject:model];
        }
        if (success) {
            success(temp.copy);
        }
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"%@",error.description);
    }];
}
@end
